-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Truncate mutation journal as logs get reconciled #4410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cep-45-mutation-tracking
Are you sure you want to change the base?
Conversation
patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-20710
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
I would personally add an integration test, similar to JournalGCTest
: you populate keyspace, flush all tables, run discard
, and make sure everything's discarded.
into.add(segment.asStatic()); | ||
} | ||
|
||
void selectStatic(Predicate<StaticSegment<K, V>> filter, Collection<StaticSegment<K, V>> into) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we cache static segments to avoid re-filtering every time?
} | ||
}, | ||
compactor(cfs, userVersion)); | ||
this.journal = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to extract this portion of the patch and get it committed to trunk
.
if (index == null) | ||
index = OnDiskIndex.rebuildAndPersist(descriptor, keySupport, metadata.fsyncLimit()); | ||
|
||
KeyStats.Static<K> keyStats = keyStatsFactory.load(descriptor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OffsetRangesFactory#load
doesn't seem to have any path that would return null
. Maybe instead of throwing JournalReadError
we should log it and return null?
public void truncateForTesting() | ||
{ | ||
ActiveSegment<?, ?> discarding = currentSegment; | ||
if (!discarding.isEmpty()) // if there is no data in the segement then ignore it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, and I know this is not your code, but segement
patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-20710